package com.qiaofang.applet.service.other.service.mapstruct;

import com.qiaofang.applet.service.other.domain.Topic;
import com.qiaofang.applet.service.other.service.dto.TopicDetailDto;
import com.qiaofang.applet.service.other.service.dto.TopicDto;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;

import java.util.List;


/**
 * @description
 * @author luojuan
 * @date 2020/9/12 10:42
 **/
@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface TopicMapper {

    TopicDetailDto domainToDetailDto(Topic topic);

    List<TopicDetailDto> domainToDetailDto(List<Topic> list);

    /**
     * DTO转Entity
     * @param dto /
     * @return /
     */
    Topic toEntity(TopicDto dto);

    /**
     * Entity转DTO
     * @param entity /
     * @return /
     */
    TopicDto toDto(Topic entity);

    /**
     * DTO集合转Entity集合
     * @param dtoList /
     * @return /
     */
    List<Topic> toEntity(List<TopicDto> dtoList);

    /**
     * Entity集合转DTO集合
     * @param entityList /
     * @return /
     */
    List<TopicDto> toDto(List<Topic> entityList);
}
